<% ... %>
for control-flow and no output; for example,
<% if (...) { %> <%- ... %> <% } %>
<%= ... %>
HTML escapted output; e.g., " -> &#34 ;<%- ... %>
unescaped outputejs.render(teplatestring, data)
./views
- a default directory for template files; file extension: .ejs
app.set('view engine', 'enginename')
res.render('templatefile', data)
Connect to cs.tru.ca with your account, save the above code in views/weather.ejs and test_weather.js, and complete and run it.
(Note that if the directory, views, does not exist, you need to create it.)
(Note that you might need to install ejs and express.)
How to test it?